package com.lhsy.djcloud.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lhsy.djcloud.entity.NoticeMessage;
import com.lhsy.djcloud.mapper.NoticeMessageMapper;
import com.lhsy.djcloud.service.NoticeMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangzw
 * @since 2020-09-24
 */
@Service
public class NoticeMessageServiceImpl extends ServiceImpl<NoticeMessageMapper, NoticeMessage> implements NoticeMessageService {
    @Autowired NoticeMessageMapper noticeMessageMapper;

    @Override
    public List<NoticeMessage> selectUnReadMessage(Integer userId,Integer type) {
        return noticeMessageMapper.selectUnReadMessage(userId,type);
    }
    @Override
    public List<NoticeMessage> selectUnReadMessage(Integer userId,List<Integer> types) {
        return noticeMessageMapper.selectUnReadMessageList(userId,types);
    }

    @Override
    public List<NoticeMessage> selectMyMessage(Integer userId ,Integer type,String params) {
        return noticeMessageMapper.selectMyMessage(userId,type,params);
    }

    @Override
    public List<NoticeMessage> selectMessage(Integer userId,Integer sendUserId, Integer type,String params) {
        return noticeMessageMapper.selectMessage(userId,sendUserId,type,params);
    }

    @Override
    public void delete(Integer id) {
        noticeMessageMapper.deleteById(id);
    }

    @Override
    public List<NoticeMessage> selectUnReadMessage(Integer userId, Integer sendUserId, Integer type) {
        return noticeMessageMapper.selectUnReadMessageBySend(userId,sendUserId,type);
    }

    @Override
    public List<NoticeMessage> selectAllMessage(Integer userId, Integer type) {
        return noticeMessageMapper.selectAllMessage(userId,type);
    }
}
